package sg.edu.ntu.metaweb.pastry;

import java.util.HashMap;

import sg.edu.ntu.metaweb.http.RequestHandler;

public class HTTPConnectionManager {

	HashMap<Integer, RequestHandler> connections;
	
	public HTTPConnectionManager() {
		connections = new HashMap<Integer, RequestHandler>();
	}
	
	
	public void popRequestHandler(RequestHandler request) {
		connections.put(new Integer(request.getRequestID()), request);
	}
	
	
	public RequestHandler popRequestHandler(int requestID) {
		RequestHandler requestHandler = connections.get(new Integer(requestID));
		connections.remove(new Integer(requestID));
		return requestHandler;
	}
	
}
